package com.yong.activemq.config;

import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.stereotype.Component;

import javax.jms.Queue;


@Component
@EnableJms  //代表开启适配的注解
public class ActiveMQConfig {
    @Value(value = "${activemqName}")
    private String activemqName;

    @Bean
    public Queue queue() {
        return new ActiveMQQueue(activemqName);
    }
}
